package pl.edu.agh.intobl;

import java.text.MessageFormat;

public class Demand {

	private static final String FORMAT = "{0}[{1}-{2}]/{3}";
	final int demander;
	final int load;
	final int serviceTime;
	final int readyTime;
	final int dueDate;

	public Demand(int demanderNumber, int demanderLoad, int serviceTime,
			int readyTime, int dueDate) {
		this.demander = demanderNumber;
		this.load = demanderLoad;
		this.dueDate = dueDate;
		this.serviceTime = serviceTime;
		this.readyTime = readyTime;
	}

	@Override
	public String toString() {
		return MessageFormat.format(FORMAT,
				new Object[] {
						ProblemSolver.customers.getCustomerById(demander)
								.getLabel(), readyTime, dueDate, serviceTime});
	}
}
